Ext.onReady(function(){
	var ratingResult;
	var accessURL = document.getElementById("accessURL").innerHTML;
	if(accessURL.indexOf("/rating/CustomerRating_FirstVerifyPD.jsp") > 0){
		ratingResult = '<iframe id="pdPage" src="view/rating/CustomerRating_FirstVerifyPD.jsp" frameborder="0" width="100%" height="100%"></iframe>'
	}
	else if(accessURL.indexOf("/rating/CustomerRating_SecondPD.jsp") > 0){
		ratingResult = '<iframe id="pdPage" src="view/rating/CustomerRating_SecondPD.jsp" frameborder="0" width="100%" height="100%"></iframe>'
	}
	else if (accessURL.indexOf("/rating/CustomerRating_ConfirmPD.jsp") > 0){
		ratingResult='<iframe id="pdPage" src="view/rating/CustomerRating_ConfirmPD.jsp" frameborder="0" width="100%" height="100%"></iframe>';
	}
	else 
		ratingResult = '<iframe id="pdPage" src="view/rating/CustomerRating_FirstPD.jsp" frameborder="0" width="100%" height="100%"></iframe>';

	
	var firstActive=true;
	
    var tabs = new Ext.TabPanel({
    	id:'tab',
        renderTo: 'tabPages',
        activeTab: 0,
        width:1080,
        height:720,
        bodyStyle:'padding:10px;',
        plain:true,
        defaults:{autoScroll: true},
        items:[{
                title: '<table width="100"><tr><td rowspan="2"><img src="images/next.png" width="32"/></td><td>步骤1：</td></tr><tr><td>定量因素</td></tr></table>',
                html:'<iframe src="view/rating/CustomerRating_Ratio_Special.jsp" frameborder="0" width="100%" height="100%"></iframe>',
                listeners:{  
                    activate:function(tab){  
                    	
                    }  
                }
            },{
                title: '<table width="100"><tr><td rowspan="2" text-align="right"><img src="images/next.png" width="32"/></td><td>步骤2：</td></tr><tr><td>定性因素</td></tr></table>',
                html: '<iframe src="view/rating/CustomerRating_Qua.jsp" frameborder="0" width="100%" height="100%"></iframe>',
                listeners:{  
                    activate:function(tab){  
                    	
                    }  
                }
            },{
                title: '<table width="100"><tr><td rowspan="2"><img src="images/next.png" width="32"/></td><td>步骤3：</td></tr><tr><td>调整项</td></tr></table>',
                html:'<iframe src="view/rating/CustomerRating_Adjustment.jsp" frameborder="0" width="100%" height="100%"></iframe>',
                listeners:{  
                    activate:function(tab){  
                    	
                    }  
                }
            },{
                title: '<table width="100"><tr><td rowspan="2"><img src="images/next.png" width="32"/></td><td>步骤4：</td></tr><tr><td>评级结果</td></tr></table>',
                html: '<div id = "pdPageTab">'+ratingResult+'</div>',
                listeners:{  
	            	activate:function(tab){  
	    				Ext.get('pdPageTab').dom.innerHTML = ratingResult;
	            	}  
                }
            }
        ]
    });
    

});